package com.mxpio.erp.plm.service.impl;

import com.mxpio.erp.common.enums.CommonEnums;
import com.mxpio.erp.common.plm.entity.ProjectDanger;
import com.mxpio.erp.common.plm.entity.ProjectDeliverableDraft;
import com.mxpio.erp.common.plm.service.ProjectDangerService;
import com.mxpio.erp.common.plm.service.ProjectDeliverableDraftService;

import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.jpa.query.Operator;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Service
public class ProjectDeliverableDraftServiceImpl extends BaseServiceImpl<ProjectDeliverableDraft> implements ProjectDeliverableDraftService {
    @Override
    @Transactional
    public List<ProjectDeliverableDraft> getDraft(String bizNo) {
        List<ProjectDeliverableDraft> list1 = this.list(ProjectDeliverableDraft.class, Criteria.create().addCriterion("bizNo", Operator.EQ, bizNo));
        return list1;
//        List<ProjectDeliverableDraft> projectDeliverableDrafts = new ArrayList<>();
//        List<ProjectDeliverableDraft> list = this.list(ProjectDeliverableDraft.class, Criteria.create().addCriterion("proCode", Operator.EQ, proCode));
//        for (ProjectDeliverableDraft projectDeliverableDraft : list){
//            if (projectDeliverableDraft.getIsAuditEnd().equals(CommonEnums.YesNo.NO.getCode())
//                    ||projectDeliverableDraft.getIsAuditEnd()==null){
//                projectDeliverableDrafts.add(projectDeliverableDraft);
//            }
//        }
//        return projectDeliverableDrafts;
    }
}
